<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Mocks::BaseExpectation</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Mocks::BaseExpectation</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/mocks/message_expectation_rb.html">
                vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000065">and_raise</a>&nbsp;&nbsp;
      <a href="#M000064">and_return</a>&nbsp;&nbsp;
      <a href="#M000066">and_throw</a>&nbsp;&nbsp;
      <a href="#M000067">and_yield</a>&nbsp;&nbsp;
      <a href="#M000063">expected_args</a>&nbsp;&nbsp;
      <a href="#M000069">invoke</a>&nbsp;&nbsp;
      <a href="#M000072">invoke_consecutive_return_block</a>&nbsp;&nbsp;
      <a href="#M000070">invoke_method_block</a>&nbsp;&nbsp;
      <a href="#M000073">invoke_return_block</a>&nbsp;&nbsp;
      <a href="#M000071">invoke_with_yield</a>&nbsp;&nbsp;
      <a href="#M000068">matches</a>&nbsp;&nbsp;
      <a href="#M000062">new</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">sym</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000062" class="method-detail">
        <a name="M000062"></a>

        <div class="method-heading">
          <a href="#M000062" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(error_generator, expectation_ordering, expected_from, sym, method_block, expected_received_count=1, opts={})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000062-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 7</span>
 7:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">error_generator</span>, <span class="ruby-identifier">expectation_ordering</span>, <span class="ruby-identifier">expected_from</span>, <span class="ruby-identifier">sym</span>, <span class="ruby-identifier">method_block</span>, <span class="ruby-identifier">expected_received_count</span>=<span class="ruby-value">1</span>, <span class="ruby-identifier">opts</span>={})
 8:         <span class="ruby-ivar">@error_generator</span> = <span class="ruby-identifier">error_generator</span>
 9:         <span class="ruby-ivar">@error_generator</span>.<span class="ruby-identifier">opts</span> = <span class="ruby-identifier">opts</span>
10:         <span class="ruby-ivar">@expected_from</span> = <span class="ruby-identifier">expected_from</span>
11:         <span class="ruby-ivar">@sym</span> = <span class="ruby-identifier">sym</span>
12:         <span class="ruby-ivar">@method_block</span> = <span class="ruby-identifier">method_block</span>
13:         <span class="ruby-ivar">@return_block</span> = <span class="ruby-identifier">lambda</span> {}
14:         <span class="ruby-ivar">@received_count</span> = <span class="ruby-value">0</span>
15:         <span class="ruby-ivar">@expected_received_count</span> = <span class="ruby-identifier">expected_received_count</span>
16:         <span class="ruby-ivar">@args_expectation</span> = <span class="ruby-constant">ArgumentExpectation</span>.<span class="ruby-identifier">new</span>([<span class="ruby-constant">AnyArgsConstraint</span>.<span class="ruby-identifier">new</span>])
17:         <span class="ruby-ivar">@consecutive</span> = <span class="ruby-keyword kw">false</span>
18:         <span class="ruby-ivar">@exception_to_raise</span> = <span class="ruby-keyword kw">nil</span>
19:         <span class="ruby-ivar">@symbol_to_throw</span> = <span class="ruby-keyword kw">nil</span>
20:         <span class="ruby-ivar">@order_group</span> = <span class="ruby-identifier">expectation_ordering</span>
21:         <span class="ruby-ivar">@at_least</span> = <span class="ruby-keyword kw">nil</span>
22:         <span class="ruby-ivar">@at_most</span> = <span class="ruby-keyword kw">nil</span>
23:         <span class="ruby-ivar">@args_to_yield</span> = <span class="ruby-keyword kw">nil</span>
24:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000065" class="method-detail">
        <a name="M000065"></a>

        <div class="method-heading">
          <a href="#M000065" class="method-signature">
          <span class="method-name">and_raise()<br />
and_raise(Exception) #any exception class<br />
and_raise(exception) #any exception object<br />
</span>
          </a>
        </div>
      
        <div class="method-description">
          <h2>Warning</h2>
<p>
When you pass an exception class, the <a
href="MessageExpectation.html">MessageExpectation</a> will raise an
instance of it, creating it with <tt><a
href="BaseExpectation.html#M000062">new</a></tt>. If the exception class
initializer requires any parameters, you must pass in an instance and not
the class.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000065-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 56</span>
56:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">and_raise</span>(<span class="ruby-identifier">exception</span>=<span class="ruby-constant">Exception</span>)
57:         <span class="ruby-ivar">@exception_to_raise</span> = <span class="ruby-identifier">exception</span>
58:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000064" class="method-detail">
        <a name="M000064"></a>

        <div class="method-heading">
          <a href="#M000064" class="method-signature">
          <span class="method-name">and_return</span><span class="method-args">(*values, &amp;return_block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000064-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 30</span>
30:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">and_return</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">values</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">return_block</span>)
31:         <span class="ruby-constant">Kernel</span><span class="ruby-operator">::</span><span class="ruby-identifier">raise</span> <span class="ruby-constant">AmbiguousReturnError</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@method_block</span>.<span class="ruby-identifier">nil?</span>
32:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
33:           <span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">nil</span>
34:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
35:           <span class="ruby-identifier">value</span> = <span class="ruby-identifier">values</span>[<span class="ruby-value">0</span>]
36:         <span class="ruby-keyword kw">else</span>
37:           <span class="ruby-identifier">value</span> = <span class="ruby-identifier">values</span>
38:           <span class="ruby-ivar">@consecutive</span> = <span class="ruby-keyword kw">true</span>
39:           <span class="ruby-ivar">@expected_received_count</span> = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">size</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@expected_received_count</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:any</span> <span class="ruby-operator">&amp;&amp;</span>
40:                                                     <span class="ruby-ivar">@expected_received_count</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">size</span>
41:         <span class="ruby-keyword kw">end</span>
42:         <span class="ruby-ivar">@return_block</span> = <span class="ruby-identifier">block_given?</span> <span class="ruby-value">? </span><span class="ruby-identifier">return_block</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">value</span> }
43:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000066" class="method-detail">
        <a name="M000066"></a>

        <div class="method-heading">
          <a href="#M000066" class="method-signature">
          <span class="method-name">and_throw</span><span class="method-args">(symbol)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000066-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 60</span>
60:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">and_throw</span>(<span class="ruby-identifier">symbol</span>)
61:         <span class="ruby-ivar">@symbol_to_throw</span> = <span class="ruby-identifier">symbol</span>
62:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000067" class="method-detail">
        <a name="M000067"></a>

        <div class="method-heading">
          <a href="#M000067" class="method-signature">
          <span class="method-name">and_yield</span><span class="method-args">(*args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000067-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 64</span>
64:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">and_yield</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
65:         <span class="ruby-ivar">@args_to_yield</span> = <span class="ruby-identifier">args</span>
66:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000063" class="method-detail">
        <a name="M000063"></a>

        <div class="method-heading">
          <a href="#M000063" class="method-signature">
          <span class="method-name">expected_args</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000063-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 26</span>
26:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expected_args</span>
27:         <span class="ruby-ivar">@args_expectation</span>.<span class="ruby-identifier">args</span>
28:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000069" class="method-detail">
        <a name="M000069"></a>

        <div class="method-heading">
          <a href="#M000069" class="method-signature">
          <span class="method-name">invoke</span><span class="method-args">(args, block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000069-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 72</span>
72:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invoke</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
73:         <span class="ruby-ivar">@order_group</span>.<span class="ruby-identifier">handle_order_constraint</span> <span class="ruby-keyword kw">self</span>
74: 
75:         <span class="ruby-keyword kw">begin</span>
76:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@exception_to_raise</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Class</span>
77:             <span class="ruby-ivar">@exception_instance_to_raise</span> = <span class="ruby-ivar">@exception_to_raise</span>.<span class="ruby-identifier">new</span>
78:           <span class="ruby-keyword kw">else</span> 
79:             <span class="ruby-ivar">@exception_instance_to_raise</span> = <span class="ruby-ivar">@exception_to_raise</span>
80:           <span class="ruby-keyword kw">end</span>
81:           <span class="ruby-constant">Kernel</span><span class="ruby-operator">::</span><span class="ruby-identifier">raise</span> <span class="ruby-ivar">@exception_to_raise</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@exception_to_raise</span>.<span class="ruby-identifier">nil?</span>
82:           <span class="ruby-constant">Kernel</span><span class="ruby-operator">::</span><span class="ruby-identifier">throw</span> <span class="ruby-ivar">@symbol_to_throw</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@symbol_to_throw</span>.<span class="ruby-identifier">nil?</span>
83: 
84:           <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@method_block</span>.<span class="ruby-identifier">nil?</span>
85:             <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_method_block</span>(<span class="ruby-identifier">args</span>)
86:           <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@args_to_yield</span>.<span class="ruby-identifier">nil?</span>
87:             <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_with_yield</span>(<span class="ruby-identifier">block</span>)
88:           <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@consecutive</span>
89:             <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_consecutive_return_block</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
90:           <span class="ruby-keyword kw">else</span>
91:             <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_return_block</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
92:           <span class="ruby-keyword kw">end</span>
93:         <span class="ruby-keyword kw">ensure</span>
94:           <span class="ruby-ivar">@received_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
95:         <span class="ruby-keyword kw">end</span>
96:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000068" class="method-detail">
        <a name="M000068"></a>

        <div class="method-heading">
          <a href="#M000068" class="method-signature">
          <span class="method-name">matches</span><span class="method-args">(sym, args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000068-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 68</span>
68:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">args</span>)
69:         <span class="ruby-ivar">@sym</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">sym</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@args_expectation</span>.<span class="ruby-identifier">check_args</span>(<span class="ruby-identifier">args</span>)
70:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000072" class="method-detail">
        <a name="M000072"></a>

        <div class="method-heading">
          <a href="#M000072" class="method-signature">
          <span class="method-name">invoke_consecutive_return_block</span><span class="method-args">(args, block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000072-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 118</span>
118:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invoke_consecutive_return_block</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
119:         <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span>
120:         <span class="ruby-identifier">value</span> = <span class="ruby-ivar">@return_block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
121:         
122:         <span class="ruby-identifier">index</span> = [<span class="ruby-ivar">@received_count</span>, <span class="ruby-identifier">value</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>].<span class="ruby-identifier">min</span>
123:         <span class="ruby-identifier">value</span>[<span class="ruby-identifier">index</span>]
124:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000070" class="method-detail">
        <a name="M000070"></a>

        <div class="method-heading">
          <a href="#M000070" class="method-signature">
          <span class="method-name">invoke_method_block</span><span class="method-args">(args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000070-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 100</span>
100:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invoke_method_block</span>(<span class="ruby-identifier">args</span>)
101:         <span class="ruby-keyword kw">begin</span>
102:           <span class="ruby-ivar">@method_block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
103:         <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">detail</span>
104:           <span class="ruby-ivar">@error_generator</span>.<span class="ruby-identifier">raise_block_failed_error</span> <span class="ruby-ivar">@sym</span>, <span class="ruby-identifier">detail</span>.<span class="ruby-identifier">message</span>
105:         <span class="ruby-keyword kw">end</span>
106:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000073" class="method-detail">
        <a name="M000073"></a>

        <div class="method-heading">
          <a href="#M000073" class="method-signature">
          <span class="method-name">invoke_return_block</span><span class="method-args">(args, block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000073-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 126</span>
126:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invoke_return_block</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
127:         <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span>
128:         <span class="ruby-identifier">value</span> = <span class="ruby-ivar">@return_block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
129:     
130:         <span class="ruby-identifier">value</span>
131:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000071" class="method-detail">
        <a name="M000071"></a>

        <div class="method-heading">
          <a href="#M000071" class="method-signature">
          <span class="method-name">invoke_with_yield</span><span class="method-args">(block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000071-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 108</span>
108:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invoke_with_yield</span>(<span class="ruby-identifier">block</span>)
109:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span>
110:           <span class="ruby-ivar">@error_generator</span>.<span class="ruby-identifier">raise_missing_block_error</span> <span class="ruby-ivar">@args_to_yield</span>
111:         <span class="ruby-keyword kw">end</span>
112:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@args_to_yield</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
113:           <span class="ruby-ivar">@error_generator</span>.<span class="ruby-identifier">raise_wrong_arity_error</span> <span class="ruby-ivar">@args_to_yield</span>, <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
114:         <span class="ruby-keyword kw">end</span>
115:         <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-ivar">@args_to_yield</span>)
116:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>